The term “layout” in user interface application platforms refers to the sizes and positions of user interface elements, such as text boxes, buttons, image boxes, and so forth. Layout has traditionally been a very difficult problem to solve in terms of the balance between power and simplicity. Typically, the more powerful a layout system, the more complex it needs to be. However, as the complexity of the system increases, so does the investment a developer has to make in becoming educated as to the behavior of the system. The cost of the investment can be prohibitive, whereby a developer may settle for a simpler but less powerful layout solution.
For example, layout needs logic to handle dynamic changes. Consider that as an application window is resized, the sizes and positions of at least some user interface elements within that window need to change, or be removed or added back. Less dynamic, but still variable changes occur when the user interface language is changed as part of globalizing a program. What may be a short string on an element in one language may be a long string when translated to another language.
Even when dealing with the same language, another example of a significant problem of user interface is that the sizes of user interface elements are not always known ahead of time. Text and other content that needs to be displayed can be obtained dynamically, and thus may be variable in size. If a user interface element needs more space than can be provided, existing layout systems are not consistent with respect to handling such constraints.
In general, simple layout systems are not always able to properly deal with changes to user interface elements. At the same time, complex layout systems that are better able to handle the dynamic nature of user interface layout are difficult to implement. What is needed is a layout system and method that is consistent and uniform in handling user interface elements. Such a layout system should be straightforward for developers to use, and extensible to handle other layout needs as they arise.